package testbrowser;

import javax.inject.Inject;

import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

public class MardiClass {

	@Inject
	protected Composite parent;

	@Inject
	public void init() {

		// cr�ation de la grile
		GridLayout layout = new GridLayout(2, false);
		parent.setLayout(layout);

		// objet texte
		final Text text = new Text(parent, SWT.NONE);
		text.setText("www.google.com");

		GridData data = new GridData(GridData.FILL, GridData.BEGINNING, true,
				false, 1, 1);
		text.setLayoutData(data);

		// objet bouton
		Button button = new Button(parent, SWT.NONE);
		button.setText("Go To");
		data = new GridData(GridData.FILL, GridData.BEGINNING, false, false, 1,
				1);
		button.setLayoutData(data);

		Browser b = new Browser(parent, SWT.NONE);
		data = new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1);
		b.setLayoutData(data);

		b.setUrl("www.google.com");

		button.addSelectionListener(new SelectionAdapter() {
		});
	}

}
